/*
 * ProcessParser.cpp
 *
 *  Created on: 2010-9-13
 *      Author: anod
 */
#include <cstdlib>
#include <stdexcept>

#include <Module-AppConfig/AppConfig.hpp>
#include <Module-AppData/parser/ProcessParser.hpp>

namespace AppData
{
using AppConfig::appConfig;
using AppConfig::WidgetConfig;

int ProcessParser::parse()
{
	if( appConfig.getPolicy()!=WidgetConfig::POLICY_TYPE_PROCESS ) //这个是不可原谅的逻辑错误了
		throw std::logic_error( "call process parser for non-process policy" );

	return system(  appConfig.getScript().toLocal8Bit().constData()  );
}

}
